package me.luck2.wicketcaptcha;

import org.apache.wicket.Page;
import org.apache.wicket.protocol.http.WebApplication;
import org.wicketstuff.annotation.scan.AnnotatedMountScanner;

import com.google.common.base.Charsets;

import de.agilecoders.wicket.core.Bootstrap;
import de.agilecoders.wicket.core.settings.BootstrapSettings;
import de.agilecoders.wicket.core.settings.DefaultThemeProvider;
import de.agilecoders.wicket.themes.markup.html.bootswatch.BootswatchTheme;
import de.agilecoders.wicket.webjars.WicketWebjars;

public class WicketApplication extends WebApplication {

	public WicketApplication() {
	}

	@Override
	public Class<? extends Page> getHomePage() {
		return HomePage.class;
	}

	@Override
	public void init() {
		super.init();
	    getMarkupSettings().setDefaultMarkupEncoding(Charsets.UTF_8.name());
	    getMarkupSettings().setCompressWhitespace(true);
		new AnnotatedMountScanner().scanPackage("me.luck2.wicketcage").mount(this);
		WicketWebjars.install(this);
		BootstrapSettings settings = new BootstrapSettings();
		DefaultThemeProvider themeProvider = new DefaultThemeProvider() {
			{
				addDefaultTheme(BootswatchTheme.CERULEAN);
			}
		};
		settings.setThemeProvider(themeProvider);
		Bootstrap.install(this, settings);
	}
}
